import request from "@/api/request";
//方法二
// import routerT from '@/router/index'
export default {
    async login_a({commit},{user_name,password,routerT}){
        console.log(user_name,password);
        let result = await request({method:'post',url:'/login',arg:{user_name,password},headerType:'form'})
        console.log(result);
        if(result.data.info == "登录成功！！"){
            routerT.push({
                name:'home'
            })
        }
        commit('login',{user_name,info:result.data.info,token:result.data.token});
        console.log(commit);
    }
}